package com.xie.test;

import java.util.regex.Pattern;

/**
 * @author xiezhendong
 * @date 2021/11/2
 */
public class test7 {

    private static final Pattern mobilePattern2 = Pattern.compile("\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");

    private static final Pattern EMAIL_PATTERN = Pattern.compile("^\\s*?(.+)@(.+?)\\s*$");

    public static void main(String[] args) throws Exception {

        String email = "92021052000@function-test.com";
        System.out.println(email + "    :   " + EMAIL_PATTERN.matcher(email).matches());
        email = "92021052000-@function-test.com";
        System.out.println(email + "    :   " + EMAIL_PATTERN.matcher(email).matches());
        email = "920210520--00@function-test.com";
        System.out.println(email + "    :   " + EMAIL_PATTERN.matcher(email).matches());
        email = "92021052000@-function-test.com";
        System.out.println(email + "    :   " + EMAIL_PATTERN.matcher(email).matches());
    }
}
